package IO;

import java.io.*;

public class PWDemo {
    public static void main(String[] args) throws IOException {
//        底层链接了BufferedWriter，OutputStreamWriter，FileOutputStream
        PrintWriter pw = new PrintWriter("pw.txt");
        pw.println("明月几时有，把酒问青天");
        pw.println("不知天上宫阙，今夕是何年");
        pw.println("我欲乘风归去，又恐琼楼玉宇");
        System.out.println("ending");
        pw.close();

//        FileOutputStream fos = new FileOutputStream("pw.txt");
//        OutputStreamWriter osw = new OutputStreamWriter(fos);
//        BufferedWriter bw = new BufferedWriter(osw);
//        bw.write("当一艘船沉入海底，当一个人成了迷");
//        bw.write("\t"+"你不知道他们为何离去，就像你不知道这竟是结局");
//        System.out.println("完毕");
//        bw.flush();
    }
}
